<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改大区会长产品合作')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-agentCooperate-edit" th:object="${zsyhAgentCooperate}">
            <h4 class="form-header h4">大区会长产品合作信息</h4>
            <input id="cooperateId" name="id" th:field="*{id}" type="hidden">
            <input name="id" th:field="*{partsId}" type="hidden">
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">会长名称：</label>
                        <div class="col-sm-8">
                            <p name="agentName" style="border-width: 0px;padding:6px 4px;"  class="form-control">[[*{agentName}]]</p>
                            <!--<input name="agentId" th:field="*{agentName}" class="form-control" type="text">-->
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">产品名称：</label>
                        <div class="col-sm-8">
                            <p name="partsName" style="border-width: 0px;padding:6px 4px;"  class="form-control">[[*{partsName}]]</p>
                            <!--<input name="partsId" th:field="*{partsId}" class="form-control" type="text">-->
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">区域内人口总数：</label>
                        <div class="col-sm-8">
                            <p name="peopleNum" style="border-width: 0px;padding:6px 4px;"  class="form-control">[[*{peopleNum}]]</p>
                            <!--<input name="peopleNum" th:field="*{peopleNum}" class="form-control" type="text">-->
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">销售额：</label>
                        <div class="col-sm-8">
                            <p name="salesVolume" style="border-width: 0px;padding:6px 4px;"  class="form-control">[[*{salesVolume}]]</p>
                            <!--<input name="salesVolume" th:field="*{salesVolume}" class="form-control" type="text">-->
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">保证金：</label>
                        <div class="col-sm-8">
                            <p name="earnestMoney" style="border-width: 0px;padding:6px 4px;"  class="form-control">[[*{earnestMoney}]]</p>
                            <!--<input name="earnestMoney" th:field="*{earnestMoney}" class="form-control" type="text">-->
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">合作产品的年份：</label>
                        <div class="col-sm-8">
                            <p name="year" style="border-width: 0px;padding:6px 4px;"  class="form-control">[[*{year}]]</p>
                            <!--<input name="year" th:field="*{year}" class="form-control" type="text">-->
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">人口销售额比例：</label>
                        <div class="col-sm-8">
                            <p name="populationSalesRatio" style="border-width: 0px;padding:6px 4px;"  class="form-control">[[*{populationSalesRatio}]]</p>
                            <!--<input name="populationSalesRatio" th:field="*{populationSalesRatio}" class="form-control" type="text">-->
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">销售额定金比例：</label>
                        <div class="col-sm-8">
                            <p name="salesPaymentRatio" style="border-width: 0px;padding:6px 4px;"  class="form-control">[[*{salesPaymentRatio}]]</p>
                            <!--<input name="salesPaymentRatio" th:field="*{salesPaymentRatio}" class="form-control" type="text">-->
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">政策简介：</label>
                        <div class="col-sm-8">
                            <textarea name="cooperationPolicy" class="form-control">[[*{cooperationPolicy}]]</textarea>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">备注：</label>
                        <div class="col-sm-8">
                            <textarea name="remarks" class="form-control">[[*{remarks}]]</textarea>
                        </div>
                    </div>
                </div>
            </div>
            <h4 class="form-header h4">大区会长产品合作区域信息</h4>
            <div class="row">
                <div class="col-sm-12">
                    <div class="col-sm-12 select-table table-bordered">
                        <table id="bootstrap-table"></table>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "zsyh/agentCooperate";
        $("#form-agentCooperate-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-agentCooperate-edit').serialize());
            }
        }

        $(function() {
            var options = {
                url: prefix + "/listChild?cooperateId="+$("#cooperateId").val(),
                pagination: false,
                showSearch: false,
                showRefresh: false,
                showToggle: false,
                showColumns: false,
                sidePagination: "client",
                columns: [
                {
                    field: 'index',
                    align: 'center',
                    title: "序号",
                    formatter: function (value, row, index) {
                    	var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
                    	return columnIndex + $.table.serialNumber(index);
                    }
                },
                /*{
                    field: 'createTime',
                    align: 'center',
                    title: '创建时间',
                    formatter: function(value, row, index) {
                        var html = $.common.sprintf("<input class='form-control' type='text' name='zsyhAgentCooperateRelList[%s].createTime' value='%s'>", index, value);
                        return html;
                    }
				},
                {
                    field: 'updateTime',
                    align: 'center',
                    title: '修改时间',
                    formatter: function(value, row, index) {
                        var html = $.common.sprintf("<input class='form-control' type='text' name='zsyhAgentCooperateRelList[%s].updateTime' value='%s'>", index, value);
                        return html;
                    }
				},*/
                /*{
                    field: 'agentId',
                    align: 'center',
                    title: '会长id',
                    formatter: function(value, row, index) {
                        var html = $.common.sprintf("<input class='form-control' type='text' name='zsyhAgentCooperateRelList[%s].agentId' value='%s'>", index, value);
                        return html;
                    }
				},*/
                {
                    field: 'partsName',
                    align: 'center',
                    title: '产品名称',
                    /*formatter: function(value, row, index) {
                        var html = $.common.sprintf("<input class='form-control' type='text' name='zsyhAgentCooperateRelList[%s].partsId' value='%s'>", index, value);
                        return html;
                    }*/
				},
                {
                    field: 'year',
                    align: 'center',
                    title: '合作产品的年份',
                    /*formatter: function(value, row, index) {
                        var html = $.common.sprintf("<input class='form-control' type='text' name='zsyhAgentCooperateRelList[%s].year' value='%s'>", index, value);
                        return html;
                    }*/
				},
                {
                    field: 'provinceName',
                    align: 'center',
                    title: '省份名称',
                    /*formatter: function(value, row, index) {
                        var html = $.common.sprintf("<input class='form-control' type='text' name='zsyhAgentCooperateRelList[%s].provinceName' value='%s'>", index, value);
                        return html;
                    }*/
				},
                {
                    field: 'cityName',
                    align: 'center',
                    title: '市区名称',
                    /*formatter: function(value, row, index) {
                        var html = $.common.sprintf("<input class='form-control' type='text' name='zsyhAgentCooperateRelList[%s].cityName' value='%s'>", index, value);
                        return html;
                    }*/
				},
                {
                    field: 'districtName',
                    align: 'center',
                    title: '区县名称',
                    /*formatter: function(value, row, index) {
                        var html = $.common.sprintf("<input class='form-control' type='text' name='zsyhAgentCooperateRelList[%s].districtName' value='%s'>", index, value);
                        return html;
                    }*/
				
                },{
                        field: 'peopleNum',
                        align: 'center',
                        title: '人口数量(万)'
                    },]
            };
            $.table.init(options);
        });


    </script>
</body>
</html>